package com.warren.system.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.warren.response.Result;
import com.warren.system.entity.Department;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author warren
 * @since 2021-03-22
 */
public interface DepartmentService extends IService<Department> {

    /**
     * 查询部门人数
     * @return
     */
    List<Department> findDeptAndCount();

    /**
     * 通过id查找id
     * @param departmentId
     * @return
     */
    Department findDeptById(Long departmentId);

    /**
     * 查询部门人数
     * @param queryWrapper
     * @return
     */
    List<Department> getDeptAndCount(QueryWrapper<Department> queryWrapper);

    /**
     * 添加部门
     * @param department
     * @return
     */
    Result addDept(Department department);

    /**
     * 更新部门
     * @param department
     * @return
     */
    Result updateDept(Department department);

    /**
     * 删除部门
     * @param id
     * @return
     */
    Result deleteDept(Long id);

    /**
     * 部门用户信息导出到excel中
     * @param response
     * @param departmentLsit
     * @throws IOException
     */
    void exportDeptExcel(HttpServletResponse response,List<Department> departmentLsit) throws IOException;
}
